package com.toivan.mt.model;

import java.util.Iterator;
import java.util.List;

public class MtExpressionManager {

    private List<MtExpression> expressions;

    public List<MtExpression> getExpressions() {
        return expressions;
    }

    public void setExpressions(List<MtExpression> expressions) {
        this.expressions = expressions;
    }

    MtExpression findExpression(String name) {
        Iterator iterator = this.expressions.iterator();
        MtExpression expression;
        do {
            if (!iterator.hasNext()) {
                return null;
            }
        } while(!name.equals((expression = (MtExpression) iterator.next()).getName()));

        return expression;
    }
}
